//
//  CXShopFoodCategoryModel.m
//  Meituan_OC
//
//  Created by Tony on 16/9/27.
//  Copyright © 2016年 Tony. All rights reserved.
//

#import "CXShopFoodCategoryModel.h"
#import "CXShopFoodModel.h"

@implementation CXShopFoodCategoryModel

+ (NSArray<CXShopFoodCategoryModel *> *)dataArrayWithArr:(NSArray *)arr {
    NSMutableArray * mArr = [NSMutableArray array];
    for (NSDictionary * dict in arr) {
        CXShopFoodCategoryModel * model = [[CXShopFoodCategoryModel alloc] init];
        [model setValuesForKeysWithDictionary:dict];
        [mArr addObject:model];
    }
    
    return mArr.copy;
}




-(void)setValue:(id)value forKey:(NSString *)key {
    if ([key isEqualToString:@"spus"]) {
        // 内层字典转模型
        NSArray<CXShopFoodModel *> *foodModelList = [CXShopFoodModel dataArrayWithArr:value];
        self.spus = foodModelList;
        return;
    }
    //
    [super setValue:value forKey:key];
}


- (void)setValue:(id)value forUndefinedKey:(NSString *)key { }

@end
